package com.whales.lms.rms.web.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.whales.lms.rms.web.model.ZoneVO;
import com.whales.shared.exception.BaseException;
import com.whales.shared.service.GenericService;

@Service
public class ZoneService extends GenericService<ZoneVO, ZoneVO> {
	@Override
	public List<ZoneVO> getList(ZoneVO vo) throws Exception {
		return super.getList("zone.getZoneList", vo);
	}
	
	@Override
	public int create(ZoneVO vo) throws Exception {
		if(this.getList(vo).size() > 0){
			throw new BaseException(super.getMessage("rms.msg.exitsDuplicatedZone")); //"중복된 Zone이 존재합니다."
		}
		return super.create("zone.createZone",vo);
	}
}
